#{extends 'main.html' /}
<h2>${project.name} > Review Requests</h2><hr/>
<a href = "@{Projects.showProject(project.getEntityId())}">Back To Project</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="@{Tasks.showAllProjectTasks(project.getEntityId())}">Back To Tasks</a><br/><hr/><br/>
<h3>Task Review Requests:</h3><br/>

#{if pendingReviews}
#{list items:pendingReviews, as:'pendingReview'}
<br/>
<p style="color:black">
    ${pendingReview.reviewer.firstName} ${pendingReview.reviewer.lastName} requests to review the task <a href="@{Tasks.showTask(pendingReview.task.getEntityId())}">${pendingReview.task.description}</a>
    <br/>
    <br/>
    <a href="javascript:showDialogHelper('Confirmation','Note that if there is someone already reviewing that task, he will automatically be removed. Are you sure you want to continue?',true,'@{Tasks.renderAcceptReviewRequest(pendingReview.getEntityId())}','prompt');">Accept </a>
    <a href="@{Tasks.renderRejectReviewRequest(pendingReview.getEntityId())}">Reject </a>
</p>
<br/>
<hr/> #{/list}
#{/if}
#{else}<label>You have no pending task review requests!</label><br/><br/>
#{/else}
#{secure.check 'approve task type review requests'}

<h3>Task Type Review Requests:</h3><br/>
#{if !projectTaskTypeReviews}
#{if !componentTaskTypeReviews}
<label>You have no pending task type review requests!</label><br/>
#{/if}
#{/if}
<br/>
<br/>
#{list items:projectTaskTypeReviews, as:'pTaskTypeReview'}
<br/>
${pTaskTypeReview.reviewer.firstName} ${pTaskTypeReview.reviewer.lastName} requests to review the task type "${pTaskTypeReview.taskType.type}" for the whole project.
<br/>
<br/>
<a href="@{TaskTypes.acceptReviewRequest(pTaskTypeReview.getEntityId())}"> Accept </a>
&nbsp; &nbsp; &nbsp;<a href="@{TaskTypes.rejectReviewRequest(pTaskTypeReview.getEntityId())}"> Reject </a>
<br/>
<br/><hr/>
#{/list}
#{list items:componentTaskTypeReviews, as:'cTaskTypeReview'}
<br/>
${cTaskTypeReview.reviewer.firstName} ${cTaskTypeReview.reviewer.lastName} requests to review the task type "${cTaskTypeReview.taskType.type}" for the component "${cTaskTypeReview.component.name}".
<br/>
<br/>
<a href="@{TaskTypes.acceptReviewRequest(cTaskTypeReview.getEntityId())}"> Accept </a>&nbsp;&nbsp;&nbsp;<a href="@{TaskTypes.rejectReviewRequest(cTaskTypeReview.getEntityId())}"> Reject </a>
<br/>
<hr/> #{/list}
#{/secure.check}
